Update dependency @azure/openai to v2 #241
Open
+16
−249
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Coming soon: The Renovate bot (GitHub App) will be renamed to Mend. PRs from Renovate will soon appear from 'Mend'. Learn more here.
This PR contains the following updates:
^1.0.0-beta.11
->^2.0.0
Release Notes
Azure/azure-sdk-for-js (@azure/openai)
v2.0.0
Compare Source
2.0.0 (2021-10-15)
After multiple beta releases over the past year, we're proud to announce the general availability of version 2 of the
@azure/identity
package. This version includes the best parts of v1, plus several improvements.This changelog entry showcases the changes that have been made from version 1 of this package. See the v1-to-v2 migration guide for details on how to upgrade your application to use the version 2 of
@azure/identity
. For information on troubleshooting the Identity package, see the troubleshooting guide.Features Added
Plugin API
Identity v2 provides a top-level
useIdentityPlugin
function, which allows using two new plugin packages:VisualStudioCodeCredential
and enables it.@azure/identity-vscode
plugin isn't used through theuseIdentityPlugin
function, theVisualStudioCodeCredential
exposed by Identity v2 will throw aCredentialUnavailableError
.Most credentials on Identity v2 now support the persistent token caching feature. Such credentials include the property tokenCachePersistenceOptions in the constructor options which can be used to enable this feature.
The following example showcases how to enable persistence caching by first enabling the
@azure/identity-cache-persistence
plugin withuseIdentityPlugin(cachePersistencePlugin)
, and then passing thetokenCachePersistenceOptions
through the constructor of theDeviceCodeCredential
:New credentials
Identity v2 includes two new credential types:
AzurePowerShellCredential
, which re-uses any account previously authenticated with theAz.Account
PowerShell module.OnBehalfOfCredential
, which enables the On-Behalf-Of authentication flow.New features in all credentials
Identity v2 enables:
AZURE_IDENTITY_DISABLE_CP1
to any value. For more about claims challenges, see Claims challenges, claims requests, and client capabilities.ManagedIdentityCredential
.getToken
directly, sending the newtenantId
property.AZURE_IDENTITY_DISABLE_MULTITENANTAUTH
. For more about multitenancy, see Identity management in multitenant apps.New features in InteractiveBrowserCredential and DeviceCodeCredential
You can now control when the credential requests user input with the new
disableAutomaticAuthentication
option added to the options you pass to the credential constructors.getToken()
method from requesting user input in case the credential is unable to authenticate silently.getToken()
fails to authenticate without user interaction, anddisableAutomaticAuthentication
has been set to true, a new error will be thrown:AuthenticationRequired
. You may use this error to identify scenarios when manual authentication needs to be triggered (withauthenticate()
, as described in the next point).A new method
authenticate()
is added to these credentials which is similar togetToken()
, but it does not read thedisableAutomaticAuthentication
option described above.AuthenticationRecord
which you can then use to create new credentials that will re-use the token information.AuthenticationRecord
object has aserialize()
method that allows an authenticated account to be stored as a string and re-used in another credential at any time. Use the new helper functiondeserializeAuthenticationRecord
to de-serialize this string.authenticate()
might succeed and still returnundefined
if we're unable to pick just one account record from the cache. This might happen if the cache is being used by more than one credential, or if multiple users have authenticated using the same Client ID and Tenant ID. To ensure consistency on a program with many users, please keep track of theAuthenticationRecord
and provide them in the constructors of the credentials on initialization.Learn more via the below samples
New features in ManagedIdentityCredential
In Identity v2, the
ManagedIdentityCredential
retries with exponential back-off when a request for a token fails with a 404 status code. This change only applies to environments with available IMDS endpoints.Azure Service Fabric support hasn't been added on the initial version 2 of Identity. Subscribe to issue #12420 for updates on this feature.
Other features
ClientCertificateCredential
now optionally accepts a configuration object as its third constructor parameter, instead of the PEM certificate path. This new object, calledClientCertificateCredentialPEMConfiguration
, can contain either the PEM certificate path with thecertificatePath
property, or the contents of the PEM certificate with thecertificate
property..InteractiveBrowserCredential
has Proof Key for Code Exchange (PKCE) enabled by default.InteractiveBrowserCredential
has a newloginHint
constructor option, which allows a username to be pre-selected for interactive logins.AzureCliCredential
, we allow specifying atenantId
in the parameters through theAzureCliCredentialOptions
.AuthenticationRequiredError
, has been added. This error shows up when a credential fails to authenticate silently.Breaking changes
Breaking changes from v1
For
ClientCertificateCredential
specifically, the validity of the PEM certificate is evaluated ongetToken
and not on the constructor.We have also renamed the error
CredentialUnavailable
toCredentialUnavailableError
, to align with the naming convention used for error classes in the Azure SDKs in JavaScript.In v1 of Identity some
getToken
calls could resolve withnull
in the case the authentication request succeeded with a malformed output. In v2, issues with thegetToken
method will always throw errors.Breaking changes to InteractiveBrowserCredential
InteractiveBrowserCredential
will use the Auth Code Flow with PKCE rather than Implicit Grant Flow to better support browsers with enhanced security restrictions. Learn how to migrate in the migration guide. Read more about the latestInteractiveBrowserCredential
here.InteractiveBrowserCredential
was viable only in Node.js and not for the browser. Therefore, on v2 client ID is a required parameter when using this credential in browser apps.postLogoutRedirectUri
from the options to the constructor forInteractiveBrowserCredential
. This option wasn't being used. Instead of using this option, use MSAL directly. For more information, see Authenticating with the @azure/msal-browser Public Client.VisualStudioCodeCredential
throws aCredentialUnavailableError
unless the new @azure/identity-vscode plugin is used.Standardizing the tracing span names to be
<className>.<operationName>
over<className>-<operationName>
Breaking Changes from 2.0.0-beta.4
allowMultiTenantAuthentication
option from all of the credentials. Multi-tenant authentication is now enabled by default. On Node.js, it can be disabled with theAZURE_IDENTITY_DISABLE_MULTITENANTAUTH
environment variable.ClientSecretCredential
and `ClientCertificateCredential. This feature will be added back on the next beta.Breaking Changes from 2.0.0-beta.6
ApplicationCredential
from the package. This will be re-introduced in the future.CredentialPersistenceOptions
fromDefaultAzureCredential
andEnvironmentCredential
.OnBehalfOfCredential
into a single options bag.AuthenticationRequiredError
(introduced in 2.0.0-beta.1) now has its parameters into a single options bag.AuthenticationRequiredError
(introduced in 2.0.0-beta.1) now has its parameters in a single options bag,AuthenticationRequiredErrorOptions
.InteractiveBrowserCredentialOptions
has been renamed toInteractiveBrowserCredentialNodeOptions
, andInteractiveBrowserCredentialBrowserOptions
has been namedInteractiveBrowserCredentialInBrowserOptions
.Bugs Fixed
ClientSecretCredential
,ClientCertificateCredential
, andUsernamePasswordCredential
throw if the required parameters aren't provided (even in JavaScript).AzureCliCredential
to fail when a custom tenant ID was provided.Other Changes
Identity v2 no longer includes native dependencies (neither ordinary, peer, nor optional dependencies). Previous distributions of
@azure/identity
included an optional dependency onkeytar
, which caused issues for some users in restrictive environments.Identity v2 for JavaScript now also depends on the latest available versions of
@azure/msal-common
,@azure/msal-node
, and@azure/msal-browser
. Our goal is to always be up-to-date with the MSAL versions.Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.